package com.cn.trip.service;

import com.cn.trip.DbDao.CardDao;
import com.cn.trip.bean.Account;

public class CheckOutService {
	
	public int checkOut(String card,String password,float money) {
		CardDao dao=new CardDao();
		Account account=dao.selectCard(card, password);
		if(account==null) {
			return 0;
		}else if(account.getBlance()<money){
			return 1;
		}else {
			dao.update(card, money);
			return 2;
		}
	}
}
